
{if:$msgNum>0}
<div class="prompt">
	<strong>温馨提示：</strong> 您有<span class="red">{$msgNum}</span> 条站内未读短信息，<a href="{url:/ucenter/message}">现在去看看</a>
</div>
{/if}

<!-- <header class="uc_head_red">
	<time>上一次登录时间：{echo:ISafe::get('last_login')}</time>
	<h3>您好，{$this->user['username']} 欢迎回来!</h3>
</header> -->

<section class="uc_info">
	{set:$user_ico = $this->user['head_ico']}
	<div class="user_ico">
		<img id="user_ico_img" onclick="select_ico()" src="{url:$user_ico}" onerror="this.src='{skin:image/user_ico.gif}'">
		<!-- <span onclick="select_ico()">修改头像</span> -->
	</div>
	<div class="user_info">
		<h2>{$this->user['username']}，欢迎您</h2>
		<ol class="user_baseinfo">
			<li>总积分：<a href="{url:/ucenter/integral}"><strong>{$user['point']}</strong> 分</a></li>
			<li>交易总数量：<a href="{url:/ucenter/order}"><strong>{$statistics['num']}</strong> 笔</a></li>
			<li>总消费额：<strong>￥{$statistics['amount']}</strong></li>
		</ol>
		<ol class="user_stat">
			<li>预存款余额：<strong>￥{$user['balance']}</strong></li>
			<li>优惠券：<strong>{$propData['prop_num']}</strong> 张</li>
			<li>经验值：<strong>{$user['exp']}</strong></li>
		</ol>
		<ol class="user_stat">
			<li>待评价商品：(<strong>{echo:statistics::countUserWaitComment()}</strong>)</li>
			<li>待付款订单：(<strong>{echo:statistics::countUserWaitPay()}</strong>)</li>
			<li>待确认收货：(<strong><a href="{url:/ucenter/order}">{echo:statistics::countUserWaitCommit()}</a></strong>)</li>
		</ol>
	</div>
</section>

<header class="uc_head mt30">
	<h3>我的订单</h3>
	<a href="{url:/ucenter/order}" class="more">更多 ></a>
</header>
<section class="uc_table">
	<table>
		<thead>
			<tr>
				<th>订单编号</th><th>下单日期</th><th>收货人</th><th>支付方式</th><th>总金额</th><th>订单状态</th>
			</tr>
		</thead>
		<tbody>
		{foreach:items=Api::run('getOrderListByUserid')}
		<tr>
			<td><a href="{url:/ucenter/order_detail/id/$item[id]}">{$item['order_no']}</a></td>
			<td>{$item['create_time']}</td>
			<td>{$item['accept_name']}</td>
			<td>{$this->payments[$item['pay_type']]['name']}</td>
			<td>￥{echo:($item['order_amount'])}</td>
			<td>
				{set:$orderStatus = Order_Class::getOrderStatus($item)}
				<b class="{if:$orderStatus >= 6}green{else:}orange{/if}">{echo:Order_Class::orderStatusText($orderStatus)}</b>
			</td>
		</tr>
		{/foreach}
		</tbody>
	</table>
</section>


<script>
//选择头像
function select_ico(){
	{set:$callback = urlencode(IUrl::creatUrl('/ucenter/user_ico_upload'))}
	art.dialog.open('{url:/block/photo_upload?callback=$callback}',
	{
		'id':'user_ico',
		'title':'设置头像',
		'ok':function(iframeWin, topWin)
		{
			iframeWin.document.forms[0].submit();
			return false;
		}
	});
}

//头像上传回调函数
function callback_user_ico(content){
	var content = eval(content);
	if(content.isError == true){
		alert(content.message);
	}else{
		$('#user_ico_img').prop('src',content.data);
	}
	art.dialog({id:'user_ico'}).close();
}
</script>
